hysop.backend.device.kernel_autotuner module¶
- class hysop.backend.device.kernel_autotuner.KernelAutotuner(name, tunable_kernel, **kwds)[source]¶
Bases:
object
Initialize a KernelAutotuner.
- Parameters:
name (str) – Name of this Autotuner for logging and caching purposes.
tunable_kernel (TunableKernel) – The kernel to be tuned.
- DUMP_LAST_TUNED_KERNEL = False¶
- FULL_RESULTS_KEY = '__FULL_RESULTS__'¶
- STORE_FULL_KERNEL_SOURCES = False¶
- autotune(extra_kwds, first_working=False, force_verbose=False, force_debug=False)[source]¶
Autotune the target tunable_kernels.
- Parameters:
first_working – Disable caching, build and execute first valid kernel at most one time.
extra_kwds (dict) – Extra keywords used to tune the kernel.
- abstract bench_one_from_binary(kernel, global_work_size, local_work_size, target_nruns, old_stats, best_stats, force_verbose, force_debug)[source]¶
Compile and bench one kernel by executing it nruns times. Return the compiled kernel, KernelStatistics and whether it was pruned or not.
- bench_one_from_source(tkernel, kernel_name, kernel_src, args_list, args_mapping, isolation_params, global_work_size, local_work_size, target_nruns, old_stats, best_stats, force_verbose, force_debug)[source]¶
Compile and bench one kernel by executing it nruns times. Return the compiled kernel, KernelStatistics and whether it was pruned or not.
- abstract build_from_source(kernel_name, kernel_src, build_options, force_verbose, force_debug)[source]¶
Compile one kernel from source. Return the compiled program and the kernel.
- exception hysop.backend.device.kernel_autotuner.KernelGenerationError[source]¶
Bases:
RuntimeError